<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
      <el-breadcrumb-item>商品分类</el-breadcrumb-item>
    </el-breadcrumb>

    <!--卡片视图区  -->
    <el-card>
      <!-- 添加分类----------------------------- -->
      <el-row>
        <el-button type="primary">添加分类</el-button>
      </el-row>

      <!--================表格开始=======================-->

      <!--================表格结束=======================-->


      <!-- -----分页区开始----------------------------------- -->

      <!-- -----分页区结束----------------------------------- -->
    </el-card>
  </div>
</template>

<script>
export default {
  data(){
    return{
      //查询条件
      queryInfo:{
        type:3,
        pagenum:1,
        pagesize:5
      },
      //获取的商品数据
      cateList:[],
      //总数据条数
      total:0,

    }
  },
  created(){  
    this.getCateList()
  },
  methods:{
    //1.获取商品分类的数据
    async getCateList(){
      const{data:res}=await this.$http.get('categories',{params:this.queryInfo})
      if(res.meta.status!==200){
        return this.$message.error("请求商品数据失败")
      }
      //把数据列表赋值给cateList
      this.cateList=res.data.result
      //获取总的数据条数赋值给total
      this.total=res.data.total
    }
  }
    
}
</script>

<style lang="less" scoped>

</style>